﻿<Window x:Class="StateMachine_Test_001.MainWindow2"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:rsm="http://reactivestatemaschine.codeplex.com/schemas/2013"
        mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        Title="MainWindow" x:Name="self" Height="350" Width="525">
    
    <Grid>
        <!--  Definieren der Behaviors um auf die Statemachine zuzugreifen Es wird dabei deie VisualStateGroup angeben  !-->
        <i:Interaction.Behaviors>
            <rsm:ReactiveStateMachineBehavior>
                <rsm:Mapping StateMachine="{Binding StateMachine, ElementName=self}" GroupName="VisibilityGroup"/>
            </rsm:ReactiveStateMachineBehavior>
        </i:Interaction.Behaviors>
        <!-- Die Visual States werden definiert -->
        <VisualStateManager.VisualStateGroups>
        <VisualStateGroup x:Name="VisibilityGroup">
    			<VisualStateGroup.Transitions>
    				<VisualTransition GeneratedDuration="0:0:0.6"/>
    			</VisualStateGroup.Transitions>
    			<VisualState x:Name="Deaktiv"/>
    			<VisualState x:Name="Aktiv">
    				<Storyboard>
    					<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="rectangle">
    						<EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="1"/>
    					</DoubleAnimationUsingKeyFrames>
    					<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="rectangle1">
    						<EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="0"/>
    						<EasingDoubleKeyFrame KeyTime="0:0:1.2" Value="1"/>
    					</DoubleAnimationUsingKeyFrames>
    					<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="rectangle2">
    						<EasingDoubleKeyFrame KeyTime="0:0:1.2" Value="0"/>
    						<EasingDoubleKeyFrame KeyTime="0:0:1.8" Value="1"/>
    					</DoubleAnimationUsingKeyFrames>
    					<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="rectangle3">
    						<EasingDoubleKeyFrame KeyTime="0:0:1.8" Value="0"/>
    						<EasingDoubleKeyFrame KeyTime="0:0:2.4" Value="1"/>
    					</DoubleAnimationUsingKeyFrames>
    					<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="rectangle4">
    						<EasingDoubleKeyFrame KeyTime="0:0:2.1" Value="0"/>
    						<EasingDoubleKeyFrame KeyTime="0:0:2.6" Value="1"/>
    					</DoubleAnimationUsingKeyFrames>
    					<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="rectangle5">
    						<EasingDoubleKeyFrame KeyTime="0:0:2.4" Value="0"/>
    						<EasingDoubleKeyFrame KeyTime="0:0:2.8" Value="1"/>
    					</DoubleAnimationUsingKeyFrames>
    					<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="rectangle6">
    						<EasingDoubleKeyFrame KeyTime="0:0:2.5" Value="0"/>
    						<EasingDoubleKeyFrame KeyTime="0:0:3" Value="1"/>
    					</DoubleAnimationUsingKeyFrames>
    					<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="rectangle7">
    						<EasingDoubleKeyFrame KeyTime="0:0:2.6" Value="0"/>
    						<EasingDoubleKeyFrame KeyTime="0:0:3.5" Value="1"/>
    					</DoubleAnimationUsingKeyFrames>
    				</Storyboard>
    			</VisualState>
    		</VisualStateGroup>
    	</VisualStateManager.VisualStateGroups>
   
    	<Rectangle x:Name="Test" Fill="#FF33335E" Margin="199.2,0,221.8,31.6" Stroke="Black" Height="84.8" VerticalAlignment="Bottom" MouseDown="Test_MouseDown" />
    	<Rectangle x:Name="rectangle" Fill="#FF33335E" Margin="167.2,61.6,187.4,120.4" Stroke="Black" Opacity="0"/>
    	<Rectangle x:Name="rectangle1" Fill="#FF33335E" HorizontalAlignment="Left" Height="52.8" Margin="57.6,61.6,0,0" Stroke="Black" VerticalAlignment="Top" Width="105.6" Opacity="0"/>
    	<Rectangle x:Name="rectangle2" Fill="#FF33335E" HorizontalAlignment="Left" Height="23.2" Margin="57.6,118.4,0,0" Stroke="Black" VerticalAlignment="Top" Width="23.2" Opacity="0"/>
    	<Rectangle x:Name="rectangle3" Fill="#FF33335E" HorizontalAlignment="Left" Height="23.2" Margin="84.8,118.4,0,0" Stroke="Black" VerticalAlignment="Top" Width="23.2" Opacity="0"/>
    	<Rectangle x:Name="rectangle4" Fill="#FF33335E" HorizontalAlignment="Left" Height="23.2" Margin="112,118.4,0,0" Stroke="Black" VerticalAlignment="Top" Width="23.2" Opacity="0"/>
    	<Rectangle x:Name="rectangle5" Fill="#FF33335E" HorizontalAlignment="Left" Margin="57.6,145.6,0,145.2" Stroke="Black" Width="23.2" Opacity="0"/>
    	<Rectangle x:Name="rectangle6" Fill="#FF33335E" HorizontalAlignment="Left" Margin="84.8,145.6,0,145.2" Stroke="Black" Width="23.2" Opacity="0"/>
    	<Rectangle x:Name="rectangle7" Fill="#FF33335E" HorizontalAlignment="Left" Margin="112,145.6,0,145.2" Stroke="Black" Width="23.2" Opacity="0"/>
    	<Rectangle x:Name="Test2" Fill="#FFF4F4F5" HorizontalAlignment="Right" Height="74.4" Margin="0,0,18.6,42" Stroke="Black" VerticalAlignment="Bottom" Width="70.4"/>
        
    </Grid>
</Window>
